#include "player.h"
#include <iostream>
void Player::handleEvent(const sf::Event & event, CommandQueue & commands)
{
	if (event.type == sf::Event::KeyPressed) {
		if (event.key.code == sf::Keyboard::P) {
			std::cout << "anxia p" << std::endl;
			Command output;
			output.category = Category::PlayerAircraft;
			output.action = [](SceneNode& s, sf::Time) {
				std::cout << s.getPosition().x << ","
					<< s.getPosition().y << std::endl;
			};
			commands.push(output);
		}
	}
}
void Player::handleRealtimeInput(CommandQueue & commands)
{
	const float playerSpeed = 30.f;

	if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) {
		Command moveLeft;
		moveLeft.category = Category::PlayerAircraft;
		moveLeft.action = derivedAction<Aircraft>(AircraftMover(-playerSpeed, 0.f));
		commands.push(moveLeft);
	}
}
